﻿Imports WSEntidades
Imports Utilerias
Imports WSDatos

Public Class ServidoresBL
    Public Function obtenServidorDisponible() As CatServidoresBE
        Dim servDAL As CatServidoresDAL = New CatServidoresDAL
        Try
            Return servDAL.getServidorByEstatusyCantBD(CatServidoresBE.EstatusServidor.Activo)
        Catch ex As Exception
            Log.LogException(ex, "ServidoresBL.obtenServidorDisponible")
            Return Nothing
        Finally
            servDAL = Nothing
        End Try
    End Function

    Public Function consumeDisponibleBDEnServidor(ByVal pIdServ As Integer)
        Dim servDAL As CatServidoresDAL = New CatServidoresDAL()
        Try
            Return servDAL.actualizaDisponiblesBdPorIdServidorActivo(pIdServ)
        Catch ex As Exception
            Log.LogException(ex, "ServidoresBL.consumeDisponibleBDEnServidor")
            Return False
        Finally
            servDAL = Nothing
        End Try
    End Function
End Class
